#include <iostream>
#include <thread>
#include "mthcomb.h"


// 打印长度为k的数组
void printData(unsigned char * pdata, unsigned char k){
    for(unsigned char i = 0;i!=k;i++){
        printf("%d ", pdata[i]);
    }
    printf("\n");
}


int main(){

    std::thread t{[](){
        unsigned char n = 5;
        unsigned char k = 2;

        __uint128_t total = choose(n,k);
        unsigned char *pdata = new unsigned char[k];
        for(__uint128_t i=0;i<total;i++){
            mThComb(i, total, n , k, pdata);
            printf("from t-->");
            printData(pdata,k);
        }
    }};


    std::thread t2{[](){
        unsigned char n = 5;
        unsigned char k = 2;

        __uint128_t total = choose(n,k);
        unsigned char *pdata = new unsigned char[k];
        for(__uint128_t i=0;i<total;i++){
            mThComb(i, total, n , k, pdata);
            printf("from t2--------->");
            printData(pdata,k);
        }
    }};

    t.join();
    t2.join();
    
}